<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<meta name="viewport" content="width=device-width, initial-scale=1">
<title>会员注册</title>
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" />
<script src="js/jquery-1.11.3.min.js" type="text/javascript"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script>
	
	$(function() {

		$("#registerForm").validate({
			"rules" : {
				"username" : {
					"required" : true
				},
				"password" : {
					"required" : true,
					"rangelength" : [ 6, 12 ]
				},
				"confirmpwd" : {
					"required" : true,
					"rangelength" : [ 6, 12 ],
					"equalTo" : "#password"
				},
				"email" : {
					"required" : true,
					"email" : true
				},
				"telephone" : {
					"required" : true
				},
				"name" : {
					"required" : true
				},
				"birthday" : {
					"required" : true,
					"date" : true
				},
				"sex" : {
					"required" : true
				}

			},
			"messages" : {
				"username" : {
					"required" : "用户名必须填写",
					"checkUsername":"该用户名已存在"
				},
				"password" : {
					"required" : "密码不能为空",
					"rangelength" : "密码长度在6-12位"
				},
				"confirmpwd" : {
					"required" : "确认密码不能为空",
					"rangelength" : "确认密码长度在6-12位",
					"equalTo" : "两次密码不一致"
				},
				"email" : {
					"required" : "邮箱不能为空",
					"email" : "邮箱格式不正确"
				},
				"telephone" : {
					"required" : "电话不能为空"
				},
				"name" : {
					"required" : "真实姓名不能为空"
				},
				"birthday" : {
					"required" : "生日不能为空",
					"date" : "日期格式不正确"
				},
				"sex" : {
					"required" : "性别必须选择"
				}

			},
			errorPlacement : function(error, element) { //指定错误信息位置
				if (element.is(':radio') || element.is(':checkbox')) { //如果是radio或checkbox

					error.appendTo(element.parent().parent()); //将错误信息添加当前元素的父结点后面
				} else {
					error.insertAfter(element);
				}
			}

		});
	});
</script>
<!-- 引入自定义css文件 style.css -->
<link rel="stylesheet" href="css/style.css" type="text/css" />

</head>
<body>

	<!-- 引入header.jsp -->
	<jsp:include page="/header.jsp"></jsp:include>
注册失败

	<!-- 引入footer.jsp -->
	<jsp:include page="/footer.jsp"></jsp:include>
</body>
</html>